home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 001-100 / 001-025 / 003 / cforth / lex.yy.c < prev    next >
C/C++ Source or Header  |  1995-03-17  |  16KB  |  910 lines

  1. # include "stdio.h"
  2. # define U(x) x
  3. # define NLSTATE yyprevious=YYNEWLINE
  4. # define BEGIN yybgin = yysvec + 1 +
  5. # define INITIAL 0
  6. # define YYLERR yysvec
  7. # define YYSTATE (yyestate-yysvec-1)
  8. # define YYOPTIM 1
  9. # define YYLMAX 200
  10. # define output(c) putc(c,yyout)
  11. # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
  12. # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
  13. # define yymore() (yymorfg=1)
  14. # define ECHO fprintf(yyout, "%s",yytext)
  15. # define REJECT { nstr = yyreject(); goto yyfussy;}
  16. int yyleng; extern char yytext[];
  17. int yymorfg;
  18. extern char *yysptr, yysbuf[];
  19. int yytchar;
  20. FILE *yyin = {stdin}, *yyout = {stdout};
  21. extern int yylineno;
  22. struct yysvf { 
  23.     struct yywork *yystoff;
  24.     struct yysvf *yyother;
  25.     int *yystops;};
  26. struct yysvf *yyestate;
  27. extern struct yysvf yysvec[], *yybgin;
  28. /* LEX input for FORTH input file scanner */
  29. /* 
  30.     Specifications are as follows:
  31.     This file must be run through "sed" to change 
  32.         yylex () {
  33.     to
  34.         TOKEN *yylex () {
  35.     where the sed script is
  36.         sed "s/yylex () {/TOKEN *yylex () {/" lex.yy.c
  37.  
  38.     Note that spaces have been included above so these lines won't be
  39.     mangled by sed; in actuality, the two blanks surrounding () are
  40.     removed.
  41.  
  42.     The function "yylex()" always returns a pointer to a structure:
  43.  
  44.         struct tokenrec {
  45.         int type;
  46.         char *text;
  47.         }
  48.         #define TOKEN struct tokenrec
  49.  
  50.     where the type is a hint as to the word's type:
  51.         DECIMAL for decimal literal        d+
  52.         OCTAL for octal literal        0d*
  53.         HEX for hex literal        0xd+ or 0Xd+
  54.         C_BS for a literal Backspace    '\b'
  55.         C_FF for a literal Form Feed    '\f'
  56.         C_NL for a literal Newline    '\n'
  57.         C_CR for a literal Carriage Return '\r'
  58.         C_TAB for a literal Tab '\t'
  59.         C_BSLASH for a literal backslash '\\'
  60.         C_IT for an other character literal 'x' where x is possibly '
  61.         STRING_LIT for a string literal (possibly containing \")
  62.         COMMENT for a left-parenthesis (possibly beginning a comment)
  63.         PRIM for "PRIM"
  64.         CONST for "CONST"
  65.         VAR for "VAR"
  66.         USER for "USER"
  67.         LABEL for "LABEL"
  68.         COLON for ":"
  69.         SEMICOLON for ";"
  70.         SEMISTAR for ";*" (used to make words IMMEDIATE)
  71.         NUL for the token {NUL}, which gets compiled as a null byte;
  72.             this special interpretation takes place in the COLON
  73.             code.
  74.         LIT for the word "LIT" (treated like OTHER, except that
  75.             no warning is generated when a literal follows this)
  76.         OTHER for an other word not recognized above
  77.  
  78.     Note that this is just a hint: the meaning of any string of characters
  79.     depends on the context.
  80.  
  81. */
  82. #include "forth.lex.h"
  83. TOKEN token;
  84. # define YYNEWLINE 10
  85. TOKEN *yylex(){
  86. int nstr; extern int yyprevious;
  87. while((nstr = yylook()) >= 0)
  88. yyfussy: switch(nstr){
  89. case 0:
  90. if(yywrap()) return(0); break;
  91. case 1:
  92. /* whitespace -- keep looping */ ;
  93. break;
  94. case 2:
  95.     { token.type = DECIMAL; token.text = yytext;
  96.                     return &token; }
  97. break;
  98. case 3:
  99.     { token.type = OCTAL; token.text = yytext;
  100.                     return &token; }
  101. break;
  102. case 4:
  103.     { token.type = HEX; token.text = yytext;
  104.                     return &token; }
  105. break;
  106. case 5:
  107. { token.type = C_BS; token.text = yytext; return &token; }
  108. break;
  109. case 6:
  110. { token.type = C_FF; token.text = yytext; return &token; }
  111. break;
  112. case 7:
  113. { token.type = C_NL; token.text = yytext; return &token; }
  114. break;
  115. case 8:
  116. { token.type = C_CR; token.text = yytext; return &token; }
  117. break;
  118. case 9:
  119. { token.type = C_TAB; token.text = yytext; return &token; }
  120. break;
  121. case 10:
  122. { token.type = C_BSLASH; token.text = yytext; return &token; }
  123. break;
  124. case 11:
  125. { token.type = C_LIT; token.text = yytext; return &token; }
  126. break;
  127. case 12:
  128. { token.type = STRING_LIT; token.text = yytext; 
  129.                 return &token; }
  130. break;
  131. case 13:
  132.     { token.type = COMMENT; token.text = yytext;
  133.                 return &token; }
  134. break;
  135. case 14:
  136.     { token.type = PRIM; token.text = yytext;
  137.                 return &token; }
  138. break;
  139. case 15:
  140.     { token.type = CONST; token.text = yytext;
  141.                 return &token; }
  142. break;
  143. case 16:
  144.     { token.type = VAR; token.text = yytext;
  145.                 return &token; }
  146. break;
  147. case 17:
  148.     { token.type = USER; token.text = yytext;
  149.                 return &token; }
  150. break;
  151. case 18:
  152.     { token.type = LABEL; token.text = yytext;
  153.                 return &token; }
  154. break;
  155. case 19:
  156.     { token.type = COLON; token.text = yytext;
  157.                 return &token; }
  158. break;
  159. case 20:
  160.     { token.type = SEMICOLON; token.text = yytext;
  161.                 return &token; }
  162. break;
  163. case 21:
  164.     { token.type = SEMISTAR; token.text = yytext;
  165.                 return &token; }
  166. break;
  167. case 22:
  168.     { token.type = NUL; token.text = yytext;
  169.                 return &token; }
  170. break;
  171. case 23:
  172.     { token.type = LIT; token.text = yytext;
  173.                 return &token; }
  174. break;
  175. case 24:
  176. { token.type = OTHER; token.text = yytext;
  177.                 return &token; }
  178. break;
  179. case -1:
  180. break;
  181. default:
  182. fprintf(yyout,"bad switch yylook %d",nstr);
  183. } return(0); }
  184. /* end of yylex */
  185. int yyvstop[] = {
  186. 0,
  187.  
  188. 1,
  189. 0,
  190.  
  191. 1,
  192. 0,
  193.  
  194. -24,
  195. 0,
  196.  
  197. 1,
  198. 0,
  199.  
  200. -24,
  201. 0,
  202.  
  203. -24,
  204. 0,
  205.  
  206. -13,
  207. -24,
  208. 0,
  209.  
  210. -24,
  211. 0,
  212.  
  213. -3,
  214. -24,
  215. 0,
  216.  
  217. -2,
  218. -24,
  219. 0,
  220.  
  221. -19,
  222. -24,
  223. 0,
  224.  
  225. -20,
  226. -24,
  227. 0,
  228.  
  229. -24,
  230. 0,
  231.  
  232. -24,
  233. 0,
  234.  
  235. -24,
  236. 0,
  237.  
  238. -24,
  239. 0,
  240.  
  241. -24,
  242. 0,
  243.  
  244. -24,
  245. 0,
  246.  
  247. 24,
  248. 0,
  249.  
  250. 24,
  251. 0,
  252.  
  253. -12,
  254. -24,
  255. 0,
  256.  
  257. -24,
  258. 0,
  259.  
  260. -24,
  261. 0,
  262.  
  263. 24,
  264. 0,
  265.  
  266. -24,
  267. 0,
  268.  
  269. 13,
  270. 24,
  271. 0,
  272.  
  273. 3,
  274. 24,
  275. 0,
  276.  
  277. -3,
  278. -24,
  279. 0,
  280.  
  281. -24,
  282. 0,
  283.  
  284. 2,
  285. 24,
  286. 0,
  287.  
  288. 19,
  289. 24,
  290. 0,
  291.  
  292. 20,
  293. 24,
  294. 0,
  295.  
  296. -21,
  297. -24,
  298. 0,
  299.  
  300. -24,
  301. 0,
  302.  
  303. -24,
  304. 0,
  305.  
  306. -24,
  307. 0,
  308.  
  309. -24,
  310. 0,
  311.  
  312. -24,
  313. 0,
  314.  
  315. -24,
  316. 0,
  317.  
  318. -24,
  319. 0,
  320.  
  321. -12,
  322. 0,
  323.  
  324. 12,
  325. 24,
  326. 0,
  327.  
  328. -12,
  329. -24,
  330. 0,
  331.  
  332. -11,
  333. -24,
  334. 0,
  335.  
  336. -11,
  337. 0,
  338.  
  339. -24,
  340. 0,
  341.  
  342. -24,
  343. 0,
  344.  
  345. -24,
  346. 0,
  347.  
  348. -24,
  349. 0,
  350.  
  351. -24,
  352. 0,
  353.  
  354. -24,
  355. 0,
  356.  
  357. -4,
  358. -24,
  359. 0,
  360.  
  361. 21,
  362. 24,
  363. 0,
  364.  
  365. -24,
  366. 0,
  367.  
  368. -24,
  369. 0,
  370.  
  371. -23,
  372. -24,
  373. 0,
  374.  
  375. -24,
  376. 0,
  377.  
  378. -24,
  379. 0,
  380.  
  381. -16,
  382. -24,
  383. 0,
  384.  
  385. -24,
  386. 0,
  387.  
  388. 12,
  389. 0,
  390.  
  391. -12,
  392. 0,
  393.  
  394. 12,
  395. 24,
  396. 0,
  397.  
  398. 11,
  399. 24,
  400. 0,
  401.  
  402. 11,
  403. 0,
  404.  
  405. -10,
  406. -24,
  407. 0,
  408.  
  409. -5,
  410. -24,
  411. 0,
  412.  
  413. -6,
  414. -24,
  415. 0,
  416.  
  417. -7,
  418. -24,
  419. 0,
  420.  
  421. -8,
  422. -24,
  423. 0,
  424.  
  425. -9,
  426. -24,
  427. 0,
  428.  
  429. 4,
  430. 24,
  431. 0,
  432.  
  433. -24,
  434. 0,
  435.  
  436. -24,
  437. 0,
  438.  
  439. 23,
  440. 24,
  441. 0,
  442.  
  443. -14,
  444. -24,
  445. 0,
  446.  
  447. -17,
  448. -24,
  449. 0,
  450.  
  451. 16,
  452. 24,
  453. 0,
  454.  
  455. -24,
  456. 0,
  457.  
  458. 12,
  459. 0,
  460.  
  461. 10,
  462. 24,
  463. 0,
  464.  
  465. 5,
  466. 24,
  467. 0,
  468.  
  469. 6,
  470. 24,
  471. 0,
  472.  
  473. 7,
  474. 24,
  475. 0,
  476.  
  477. 8,
  478. 24,
  479. 0,
  480.  
  481. 9,
  482. 24,
  483. 0,
  484.  
  485. -15,
  486. -24,
  487. 0,
  488.  
  489. -18,
  490. -24,
  491. 0,
  492.  
  493. 14,
  494. 24,
  495. 0,
  496.  
  497. 17,
  498. 24,
  499. 0,
  500.  
  501. -22,
  502. -24,
  503. 0,
  504.  
  505. 15,
  506. 24,
  507. 0,
  508.  
  509. 18,
  510. 24,
  511. 0,
  512.  
  513. 22,
  514. 24,
  515. 0,
  516. 0};
  517. # define YYTYPE char
  518. struct yywork { YYTYPE verify, advance; } yycrank[] = {
  519. 0,0,    0,0,    1,3,    0,0,    
  520. 0,0,    0,0,    0,0,    0,0,    
  521. 0,0,    0,0,    1,4,    1,4,    
  522. 0,0,    4,4,    4,4,    0,0,    
  523. 4,4,    4,4,    7,26,    7,26,    
  524. 11,31,    11,31,    21,44,    21,44,    
  525. 0,0,    12,32,    12,32,    33,55,    
  526. 33,55,    0,0,    42,63,    42,63,    
  527. 0,0,    42,63,    42,63,    1,5,    
  528. 4,4,    46,66,    46,66,    0,0,    
  529. 1,6,    1,7,    22,45,    3,3,    
  530. 23,46,    24,47,    1,8,    48,68,    
  531. 49,69,    1,9,    1,10,    3,19,    
  532. 3,19,    42,63,    50,70,    2,6,    
  533. 2,7,    1,10,    12,33,    1,11,    
  534. 1,12,    2,8,    5,5,    51,71,    
  535. 6,23,    52,72,    1,3,    43,64,    
  536. 1,13,    35,57,    5,20,    5,20,    
  537. 6,24,    6,19,    2,11,    2,12,    
  538. 3,3,    1,14,    37,59,    38,60,    
  539. 18,40,    1,15,    13,34,    2,13,    
  540. 15,37,    16,38,    1,16,    1,17,    
  541. 34,56,    1,3,    3,3,    3,3,    
  542. 2,14,    9,27,    9,27,    5,21,    
  543. 2,15,    6,23,    3,3,    36,58,    
  544. 22,22,    2,16,    2,17,    10,30,    
  545. 10,30,    8,9,    8,10,    3,3,    
  546. 39,61,    5,5,    5,5,    6,23,    
  547. 6,23,    8,10,    14,3,    40,62,    
  548. 41,43,    5,5,    53,73,    6,23,    
  549. 28,27,    28,27,    14,19,    14,19,    
  550. 1,18,    43,43,    5,5,    56,75,    
  551. 6,23,    57,76,    3,3,    59,78,    
  552. 9,28,    9,28,    45,65,    45,65,    
  553. 58,77,    58,77,    60,79,    2,18,    
  554. 29,54,    29,54,    10,10,    10,10,    
  555. 62,81,    25,46,    65,43,    14,3,    
  556. 29,54,    5,5,    10,10,    6,23,    
  557. 75,89,    5,22,    76,90,    6,25,    
  558. 81,93,    29,54,    82,43,    28,28,    
  559. 28,28,    14,3,    14,3,    0,0,    
  560. 47,67,    47,67,    0,0,    47,67,    
  561. 47,67,    14,3,    61,80,    61,80,    
  562. 9,29,    64,82,    64,82,    0,0,    
  563. 17,3,    0,0,    14,35,    14,3,    
  564. 14,3,    14,3,    14,3,    14,3,    
  565. 17,19,    17,19,    14,36,    47,67,    
  566. 68,83,    68,83,    69,84,    69,84,    
  567. 70,85,    70,85,    71,86,    71,86,    
  568. 72,87,    72,87,    25,48,    73,88,    
  569. 73,88,    14,3,    78,91,    78,91,    
  570. 25,49,    79,92,    79,92,    0,0,    
  571. 25,50,    17,3,    14,3,    14,3,    
  572. 14,3,    14,3,    14,3,    14,3,    
  573. 25,51,    45,22,    89,94,    89,94,    
  574. 25,52,    0,0,    25,53,    17,3,    
  575. 17,3,    90,95,    90,95,    93,96,    
  576. 93,96,    0,0,    0,0,    17,3,    
  577. 0,0,    0,0,    0,0,    0,0,    
  578. 0,0,    0,0,    20,41,    0,0,    
  579. 17,39,    17,3,    17,3,    17,3,    
  580. 17,3,    17,3,    20,41,    20,41,    
  581. 54,74,    54,74,    0,0,    0,0,    
  582. 0,0,    0,0,    0,0,    0,0,    
  583. 64,43,    0,0,    0,0,    0,0,    
  584. 0,0,    0,0,    0,0,    17,3,    
  585. 0,0,    0,0,    0,0,    0,0,    
  586. 0,0,    0,0,    0,0,    20,42,    
  587. 17,3,    17,3,    17,3,    17,3,    
  588. 17,3,    17,3,    0,0,    0,0,    
  589. 0,0,    0,0,    0,0,    0,0,    
  590. 0,0,    20,41,    20,41,    54,54,    
  591. 54,54,    0,0,    0,0,    0,0,    
  592. 0,0,    20,41,    0,0,    54,54,    
  593. 0,0,    0,0,    0,0,    0,0,    
  594. 0,0,    0,0,    20,41,    0,0,    
  595. 54,54,    0,0,    0,0,    0,0,    
  596. 0,0,    0,0,    0,0,    0,0,    
  597. 0,0,    0,0,    0,0,    0,0,    
  598. 0,0,    0,0,    0,0,    0,0,    
  599. 0,0,    0,0,    0,0,    0,0,    
  600. 0,0,    20,41,    0,0,    0,0,    
  601. 0,0,    20,43,    0,0,    0,0,    
  602. 0,0};
  603. struct yysvf yysvec[] = {
  604. 0,    0,    0,
  605. yycrank+-1,    0,        yyvstop+1,
  606. yycrank+-16,    yysvec+1,    yyvstop+3,
  607. yycrank+-42,    0,        yyvstop+5,
  608. yycrank+4,    0,        yyvstop+7,
  609. yycrank+-61,    0,        yyvstop+9,
  610. yycrank+-63,    0,        yyvstop+11,
  611. yycrank+-9,    yysvec+3,    yyvstop+13,
  612. yycrank+-57,    yysvec+3,    yyvstop+16,
  613. yycrank+-84,    yysvec+3,    yyvstop+18,
  614. yycrank+-94,    yysvec+3,    yyvstop+21,
  615. yycrank+-11,    yysvec+3,    yyvstop+24,
  616. yycrank+-16,    yysvec+3,    yyvstop+27,
  617. yycrank+-3,    yysvec+3,    yyvstop+30,
  618. yycrank+-113,    0,        yyvstop+32,
  619. yycrank+-2,    yysvec+3,    yyvstop+34,
  620. yycrank+-2,    yysvec+3,    yyvstop+36,
  621. yycrank+-175,    0,        yyvstop+38,
  622. yycrank+-2,    yysvec+3,    yyvstop+40,
  623. yycrank+0,    0,        yyvstop+42,
  624. yycrank+-237,    0,        yyvstop+44,
  625. yycrank+-13,    yysvec+3,    yyvstop+46,
  626. yycrank+-8,    yysvec+5,    yyvstop+49,
  627. yycrank+-5,    yysvec+3,    yyvstop+51,
  628. yycrank+6,    0,        yyvstop+53,
  629. yycrank+-106,    yysvec+3,    yyvstop+55,
  630. yycrank+0,    0,        yyvstop+57,
  631. yycrank+0,    0,        yyvstop+60,
  632. yycrank+-111,    yysvec+3,    yyvstop+63,
  633. yycrank+-92,    yysvec+3,    yyvstop+66,
  634. yycrank+0,    0,        yyvstop+68,
  635. yycrank+0,    0,        yyvstop+71,
  636. yycrank+0,    0,        yyvstop+74,
  637. yycrank+-18,    yysvec+3,    yyvstop+77,
  638. yycrank+-10,    yysvec+3,    yyvstop+80,
  639. yycrank+-3,    yysvec+3,    yyvstop+82,
  640. yycrank+-15,    yysvec+3,    yyvstop+84,
  641. yycrank+-5,    yysvec+3,    yyvstop+86,
  642. yycrank+-10,    yysvec+3,    yyvstop+88,
  643. yycrank+-26,    yysvec+3,    yyvstop+90,
  644. yycrank+-30,    yysvec+3,    yyvstop+92,
  645. yycrank+-24,    yysvec+20,    0,    
  646. yycrank+21,    0,        yyvstop+94,
  647. yycrank+-33,    yysvec+20,    0,    
  648. yycrank+0,    0,        yyvstop+96,
  649. yycrank+-125,    yysvec+5,    yyvstop+99,
  650. yycrank+-28,    yysvec+3,    yyvstop+102,
  651. yycrank+155,    0,        yyvstop+105,
  652. yycrank+-8,    yysvec+3,    yyvstop+107,
  653. yycrank+-9,    yysvec+3,    yyvstop+109,
  654. yycrank+-15,    yysvec+3,    yyvstop+111,
  655. yycrank+-24,    yysvec+3,    yyvstop+113,
  656. yycrank+-26,    yysvec+3,    yyvstop+115,
  657. yycrank+-79,    yysvec+3,    yyvstop+117,
  658. yycrank+-239,    yysvec+3,    yyvstop+119,
  659. yycrank+0,    0,        yyvstop+122,
  660. yycrank+-44,    yysvec+3,    yyvstop+125,
  661. yycrank+-60,    yysvec+3,    yyvstop+127,
  662. yycrank+-127,    yysvec+3,    yyvstop+129,
  663. yycrank+-54,    yysvec+3,    yyvstop+132,
  664. yycrank+-56,    yysvec+3,    yyvstop+134,
  665. yycrank+-161,    yysvec+3,    yyvstop+136,
  666. yycrank+-68,    yysvec+3,    yyvstop+139,
  667. yycrank+0,    0,        yyvstop+141,
  668. yycrank+-164,    yysvec+20,    yyvstop+143,
  669. yycrank+-54,    yysvec+20,    yyvstop+145,
  670. yycrank+0,    0,        yyvstop+148,
  671. yycrank+0,    0,        yyvstop+151,
  672. yycrank+-179,    yysvec+3,    yyvstop+153,
  673. yycrank+-181,    yysvec+3,    yyvstop+156,
  674. yycrank+-183,    yysvec+3,    yyvstop+159,
  675. yycrank+-185,    yysvec+3,    yyvstop+162,
  676. yycrank+-187,    yysvec+3,    yyvstop+165,
  677. yycrank+-190,    yysvec+3,    yyvstop+168,
  678. yycrank+0,    0,        yyvstop+171,
  679. yycrank+-68,    yysvec+3,    yyvstop+174,
  680. yycrank+-78,    yysvec+3,    yyvstop+176,
  681. yycrank+0,    0,        yyvstop+178,
  682. yycrank+-193,    yysvec+3,    yyvstop+181,
  683. yycrank+-196,    yysvec+3,    yyvstop+184,
  684. yycrank+0,    0,        yyvstop+187,
  685. yycrank+-31,    yysvec+3,    yyvstop+190,
  686. yycrank+-66,    yysvec+20,    yyvstop+192,
  687. yycrank+0,    0,        yyvstop+194,
  688. yycrank+0,    0,        yyvstop+197,
  689. yycrank+0,    0,        yyvstop+200,
  690. yycrank+0,    0,        yyvstop+203,
  691. yycrank+0,    0,        yyvstop+206,
  692. yycrank+0,    0,        yyvstop+209,
  693. yycrank+-209,    yysvec+3,    yyvstop+212,
  694. yycrank+-216,    yysvec+3,    yyvstop+215,
  695. yycrank+0,    0,        yyvstop+218,
  696. yycrank+0,    0,        yyvstop+221,
  697. yycrank+-218,    yysvec+3,    yyvstop+224,
  698. yycrank+0,    0,        yyvstop+227,
  699. yycrank+0,    0,        yyvstop+230,
  700. yycrank+0,    0,        yyvstop+233,
  701. 0,    0,    0};
  702. struct yywork *yytop = yycrank+329;
  703. struct yysvf *yybgin = yysvec+1;
  704. char yymatch[] = {
  705. 00  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  706. 01  ,011 ,012 ,01  ,011 ,011 ,01  ,01  ,
  707. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  708. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  709. 011 ,01  ,'"' ,01  ,01  ,01  ,01  ,01  ,
  710. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  711. '0' ,'1' ,'1' ,'1' ,'1' ,'1' ,'1' ,'1' ,
  712. '8' ,'8' ,01  ,01  ,01  ,01  ,01  ,01  ,
  713. 01  ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,01  ,
  714. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  715. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  716. 'X' ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  717. 01  ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,01  ,
  718. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  719. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  720. 'X' ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  721. 0};
  722. char yyextra[] = {
  723. 0,0,1,1,1,1,1,1,
  724. 1,1,1,1,1,1,1,1,
  725. 1,1,1,1,1,1,1,1,
  726. 1,0,0,0,0,0,0,0,
  727. 0};
  728. /*    @(#)ncform    1.2    */
  729. int yylineno =1;
  730. # define YYU(x) x
  731. # define NLSTATE yyprevious=YYNEWLINE
  732. char yytext[YYLMAX];
  733. struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
  734. char yysbuf[YYLMAX];
  735. char *yysptr = yysbuf;
  736. int *yyfnd;
  737. extern struct yysvf *yyestate;
  738. int yyprevious = YYNEWLINE;
  739. yylook(){
  740.     register struct yysvf *yystate, **lsp;
  741.     register struct yywork *yyt;
  742.     struct yysvf *yyz;
  743.     int yych, yyfirst;
  744.     struct yywork *yyr;
  745. # ifdef LEXDEBUG
  746.     int debug;
  747. # endif
  748.     char *yylastch;
  749.     /* start off machines */
  750. # ifdef LEXDEBUG
  751.     debug = 0;
  752. # endif
  753.     yyfirst=1;
  754.     if (!yymorfg)
  755.         yylastch = yytext;
  756.     else {
  757.         yymorfg=0;
  758.         yylastch = yytext+yyleng;
  759.         }
  760.     for(;;){
  761.         lsp = yylstate;
  762.         yyestate = yystate = yybgin;
  763.         if (yyprevious==YYNEWLINE) yystate++;
  764.         for (;;){
  765. # ifdef LEXDEBUG
  766.             if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
  767. # endif
  768.             yyt = yystate->yystoff;
  769.             if(yyt == yycrank && !yyfirst){  /* may not be any transitions */
  770.                 yyz = yystate->yyother;
  771.                 if(yyz == 0)break;
  772.                 if(yyz->yystoff == yycrank)break;
  773.                 }
  774.             *yylastch++ = yych = input();
  775.             yyfirst=0;
  776.         tryagain:
  777. # ifdef LEXDEBUG
  778.             if(debug){
  779.                 fprintf(yyout,"char ");
  780.                 allprint(yych);
  781.                 putchar('\n');
  782.                 }
  783. # endif
  784.             yyr = yyt;
  785.             if ( (int)yyt > (int)yycrank){
  786.                 yyt = yyr + yych;
  787.                 if (yyt <= yytop && yyt->verify+yysvec == yystate){
  788.                     if(yyt->advance+yysvec == YYLERR)    /* error transitions */
  789.                         {unput(*--yylastch);break;}
  790.                     *lsp++ = yystate = yyt->advance+yysvec;
  791.                     goto contin;
  792.                     }
  793.                 }
  794. # ifdef YYOPTIM
  795.             else if((int)yyt < (int)yycrank) {        /* r < yycrank */
  796.                 yyt = yyr = yycrank+(yycrank-yyt);
  797. # ifdef LEXDEBUG
  798.                 if(debug)fprintf(yyout,"compressed state\n");
  799. # endif
  800.                 yyt = yyt + yych;
  801.                 if(yyt <= yytop && yyt->verify+yysvec == yystate){
  802.                     if(yyt->advance+yysvec == YYLERR)    /* error transitions */
  803.                         {unput(*--yylastch);break;}
  804.                     *lsp++ = yystate = yyt->advance+yysvec;
  805.                     goto contin;
  806.                     }
  807.                 yyt = yyr + YYU(yymatch[yych]);
  808. # ifdef LEXDEBUG
  809.                 if(debug){
  810.                     fprintf(yyout,"try fall back character ");
  811.                     allprint(YYU(yymatch[yych]));
  812.                     putchar('\n');
  813.                     }
  814. # endif
  815.                 if(yyt <= yytop && yyt->verify+yysvec == yystate){
  816.                     if(yyt->advance+yysvec == YYLERR)    /* error transition */
  817.                         {unput(*--yylastch);break;}
  818.                     *lsp++ = yystate = yyt->advance+yysvec;
  819.                     goto contin;
  820.                     }
  821.                 }
  822.             if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
  823. # ifdef LEXDEBUG
  824.                 if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
  825. # endif
  826.                 goto tryagain;
  827.                 }
  828. # endif
  829.             else
  830.                 {unput(*--yylastch);break;}
  831.         contin:
  832. # ifdef LEXDEBUG
  833.             if(debug){
  834.                 fprintf(yyout,"state %d char ",yystate-yysvec-1);
  835.                 allprint(yych);
  836.                 putchar('\n');
  837.                 }
  838. # endif
  839.             ;
  840.             }
  841. # ifdef LEXDEBUG
  842.         if(debug){
  843.             fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
  844.             allprint(yych);
  845.             putchar('\n');
  846.             }
  847. # endif
  848.         while (lsp-- > yylstate){
  849.             *yylastch-- = 0;
  850.             if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
  851.                 yyolsp = lsp;
  852.                 if(yyextra[*yyfnd]){        /* must backup */
  853.                     while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
  854.                         lsp--;
  855.                         unput(*yylastch--);
  856.                         }
  857.                     }
  858.                 yyprevious = YYU(*yylastch);
  859.                 yylsp = lsp;
  860.                 yyleng = yylastch-yytext+1;
  861.                 yytext[yyleng] = 0;
  862. # ifdef LEXDEBUG
  863.                 if(debug){
  864.                     fprintf(yyout,"\nmatch ");
  865.                     sprint(yytext);
  866.                     fprintf(yyout," action %d\n",*yyfnd);
  867.                     }
  868. # endif
  869.                 return(*yyfnd++);
  870.                 }
  871.             unput(*yylastch);
  872.             }
  873.         if (yytext[0] == 0  /* && feof(yyin) */)
  874.             {
  875.             yysptr=yysbuf;
  876.             return(0);
  877.             }
  878.         yyprevious = yytext[0] = input();
  879.         if (yyprevious>0)
  880.             output(yyprevious);
  881.         yylastch=yytext;
  882. # ifdef LEXDEBUG
  883.         if(debug)putchar('\n');
  884. # endif
  885.         }
  886.     }
  887. yyback(p, m)
  888.     int *p;
  889. {
  890. if (p==0) return(0);
  891. while (*p)
  892.     {
  893.     if (*p++ == m)
  894.         return(1);
  895.     }
  896. return(0);
  897. }
  898.     /* the following are only used in the lex library */
  899. yyinput(){
  900.     return(input());
  901.     }
  902. yyoutput(c)
  903.   int c; {
  904.     output(c);
  905.     }
  906. yyunput(c)
  907.    int c; {
  908.     unput(c);
  909.     }
  910.